import http from '@/utils/http';

const app = {
  getApps() {
    let url = '/admin/App/GetApps';
    return http.get(url);
  },
  query() {
    let url = '/admin/App/Query';
    return http.get(url);
  },
  //获取所有目录
  getCatalogs() {
    let url = '/admin/App/GetCatalogs';
    return http.get(url);
  },
  //获取所有目录
  getNoResourceApps() {
    let url = '/admin/App/GetNoResourceApps';
    return http.get(url);
  },

  //获取pId的应用列表
  getByPId(pId: Number) {
    let url = '/admin/App/GetByPId';
    let params = { pId };
    return http.get(url, params);
  },
  //应用删除
  remove(ids: Array<Number>) {
    let url = '/admin/App/Remove';
    let params = { ids: ids };
    return http.get(url, params);
  },
  //应用详情
  detail(id: Number) {
    let url = '/admin/App/Detail';
    let params = { id: id };
    return http.get(url, params);
  },
  //应用保存
  save(app: Object) {
    let url = '/admin/App/Save';
    return http.post(url, app);
  },
};
export default app;
